package com.marsoft.test.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.marsoft.test.entity.GuarantyInsuranceInfoEntity;
import com.marsoft.test.mapper.GuarantyInsuranceInfoMapper;
import com.marsoft.test.service.GuarantyInsuranceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author FAN_c
 * @date 2021/5/21 14:23
 * @description
 */
@Service
@Transactional
public class GuarantyInsuranceInfoServiceImpl implements GuarantyInsuranceInfoService {

    @Autowired
    private GuarantyInsuranceInfoMapper guarantyInsuranceInfoMapper;

    /**
     * 押品保险信息
     * @return
     */
    @Override
    public List<GuarantyInsuranceInfoEntity> findAllGuarantyInsuranceInfo() {

        GuarantyInsuranceInfoEntity guarantyInsuranceInfoEntity = new GuarantyInsuranceInfoEntity();
        //分页起始码以及每页页数
        PageHelper.startPage(1,10);

        List<GuarantyInsuranceInfoEntity> allGuarantyInsuranceInfo = guarantyInsuranceInfoMapper.findAllGuarantyInsuranceInfo();

        PageInfo pageInfo = new PageInfo(allGuarantyInsuranceInfo);

        return pageInfo.getList();
    }
}
